//引入第三方包
var express = require('express')

//实例化express
var app = express()


//设置静态资源托管文件
app.use(express.static('static'))



//在接口之前设置处理post请求中间件
app.use(express.json())
app.use(express.urlencoded({ extended: false }))

//导入子路由
var userRouter=require('./router/userRouter')
var goodRouter=require('./router/goodRouter ')


//注册子路由
//前端发送请求'/user/list','/user/search',.....都会找userRouter
app.use('/user',userRouter)

//前端发送请求'/good/list','/good/search',.....都会找goodRouter
app.use('/good',goodRouter)

//设置接口


//设置监听
app.listen(8888)

